package homework;
//
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Iterator;
import java.util.Map;

public class work01 {
	public static void main(String[] args) {
		ArrayList<String> list = new ArrayList<>();
		list.add("zhangsan,23");
		list.add("lisi,24");
		list.add("wangwu,25");
		Map<String, Integer> map=new HashMap<>();
		
		Iterator<String> iterator = list.iterator();
		while(iterator.hasNext())
		{
			String next =iterator.next();
			String[] parts= next.split(",",2);
//			System.out.println(parts[0]);//name
//			System.out.println(parts[1]);//age
			int age = Integer.parseInt(parts[1]);
			if(age>24){
				map.put(parts[0], age);
			}
		}
		System.out.println(map);
	}
}
